package com.kayt.cyberBar.cyber.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.common.cache.PublicCache;
import com.kayt.cyberBar.cyber.business.entity.vo.CyberBaseRankVO;
import com.kayt.cyberBar.cyber.business.server.ICyberBaseRankServer;
import com.kayt.cyberBar.cyber.business.service.ICyberBaseRankService;

@Service("iCyberBaseRankService")
public class CyberBaseRankServiceImpl implements ICyberBaseRankService {

	@Autowired
	private PublicCache publicCache;
	
	@Autowired
	private ICyberBaseRankServer iCyberBaseRankServer;
	
//	@Override
//	public ServerResponse<CyberBaseRankVO> getCyberFavour (String cyberCode) {
//		CyberBaseRankVO rankVo = new CyberBaseRankVO();
//		rankVo.setNonPayment("200");
//		rankVo.setCashback("3400");
//		rankVo.setTotalCashback("7833");
//		return ServerResponse.createBySuccess(rankVo);
//	}
	
	@Override
	public ServerResponse<CyberBaseRankVO> getCyberFavour (String cyberCode) {
		CyberBaseRankVO rsp = this.iCyberBaseRankServer.get_cyber_cashback (cyberCode);
		return this.iCyberBaseRankServer.assemble_result(rsp);
	} 
}
